import http from "@/utils/request";

export default {
  //查询菜单列表
  async getMenuList(params) {
    return http.get("/api/permission/list", params);
  },

  //查询上级菜单列表
  async getParentMenuList(params) {
    return await http.get("/api/permission/parent/list", params);
  },

  //根据id查询菜单信息

  //添加菜单
  async addMenu(params) {
    return await http.post("/api/permission/add", params);
  },

  //修改菜单
  async updateMenu(params) {
    return await http.put("/api/permission/update", params);
  },

  //删除菜单
  async deleteById(params) {
    return await http.delete("/api/permission/delete", params);
  },

  //检查菜单下是否有子菜单
  async checkPermission(params) {
    return await http.getRestApi("/api/permission/check", params);
  },
};
